﻿@using SCMS.Resource
@model SCMS.UI.Models.ExpenseClaimItem
@{
    string success = Model.EntityExpseItem.Id.Equals(Guid.Empty) ? "usermsgg();ClearForm();" : "usermsgg();CloseDialog();";
    AjaxOptions ajaxOpts = new AjaxOptions
    {
        UpdateTargetId = "expenseclaimDiv",
        LoadingElementId = "loading",
        HttpMethod = "Post",
        Url = Url.Action("SaveExpseItem/" + ViewBag.ExpsCID),
        OnBegin = "checkBalance",
        OnSuccess = success
    };
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
{
    @Html.ValidationSummary(true)
    <input type="hidden" id="currencyId"  value="@ViewBag.CurrencyId" />
    <table>
        <tr>
            <td align="left" class="editor-label">
                @Resources.Global_String_Description
            </td>
            <td align="left" class="editor-field">
                @Html.TextBoxFor(model => model.EntityExpseItem.ItemDescription)
                @Html.ValidationMessageFor(model => model.EntityExpseItem.ItemDescription)
                @Html.HiddenFor(model => model.EntityExpseItem.Id)
            </td>
        </tr>
        <tr>
            <td align="left" class="editor-label">
                @Resources.Global_String_Amount
            </td>
            <td align="left" class="editor-field">
                @Html.TextBoxFor(model => model.Amount, new { id = "TotalPrice", @class = "numericTb"})
                @Html.ValidationMessageFor(model => model.Amount)
            </td>
        </tr>
        <tr>
            <td align="left" class="editor-label">
                @Resources.Budget_CategoryList_ProjectNo
            </td>
            <td align="left" class="editor-field">
                @Html.DropDownListFor(model => model.ProjectDonorId, Model.ProjectNos, Resources.Global_String_PleaseSelect, new { @id = "dplProjectNo", onchange = "javascript:selectedIndexChange4EC(this)" })
                @Html.ValidationMessageFor(model => model.ProjectDonorId)
            </td>
        </tr>
        <tr>
            <td align="left" class="editor-label">
                @Resources.Budget_CreateSubLine_LineNumber
            </td>
            <td align="left" class="editor-field">
                <div id="PBlines">
                    @Html.DropDownListFor(model => model.EntityExpseItem.BudgetLineId, Model.BudgetLines, Resources.Global_String_PleaseSelect, new { @class = "dpl", @id = "BudgetLineID", onchange = "javascript:checkBalance()" })
                    @Html.ValidationMessageFor(model => model.EntityExpseItem.BudgetLineId, Resources.Global_String_Required)
                </div>
            </td>
        </tr>
        <tr>
            <td align="left" class="editor-label" colspan="2" id="fundsCheck" valign="top">
            </td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <input type="submit" class="btn green"  value="@ViewBag.Action" />
            </td>
        </tr>
    </table>
}
